//脚本唯一关键字,通过该关键字找到对应脚本，每个脚本必须有该描述。
var v_script_id = 'user_4';
//脚本状态,0:该脚本不许执行，1:该脚本可以执行
var v_status = '1';

//脚本逻辑写在run语句之间
if (run && action.getAuthority().is(3,"3")){
	var id = action.form.getString('id');
	var username = action.form.getString('username');
	var password = action.form.getString('password');
	var realname = action.form.getString('realname');
	var gender = action.form.getString('gender');
	var phone = action.form.getString('phone');
	var email = action.form.getString('email');
	var endtime = action.form.getString('endtime');
	var state = action.form.getString('state');
	
	var sql = "update h_auth_users set username= '" + username + "', password= '" + password + 
				"', realname= '" + realname +"', gender= '" + gender +
				"', phone= '" + phone +"', email= '" + email +
				"', endtime= to_date('" + endtime +"','yyyy-mm-dd'), state= '" + state +
				"' where id=" +id;
	if(action.dbUtil.update("",sql)==0) 
	{
		action.errorCode = 2;//数据库操作失败
		action.retString = '数据库操作失败';//错误文字说明
	};
}